package com.ty.init.service.impl;

import com.ty.init.mapper.ProductMapper;
import com.ty.init.pojo.Product;
import com.ty.init.service.ProductService;
import com.ty.init.uitl.Vo.IncomeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ty
 */
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;
    @Override
    public Integer findAllProduct() {
        List<Product> allProduct = productMapper.findAllProduct();
        return allProduct.size();

    }

    @Override
    public List<Product> finProductLimit(Integer start, Integer limmit) {
        List<Product> productLimit = productMapper.findProductLimit(start, limmit);
        return productLimit;
    }

    @Override
    public Product findByID(Integer id) {
        Product product = productMapper.findByID(id);
        return product;
    }

    @Override
    public List<IncomeVo> incomeMessage() {
        List<IncomeVo> result = productMapper.incomeMessage();
        return result;
    }

}
